<template>
  <div>
    <h1>PropsSon</h1>
    <h2>{{ str }}</h2>
    <!-- <h2>{{ obj }}</h2> -->
  </div>
</template>

<script>
export default {
  name: 'PropsSon',
  components: {},
  props: {
    num: {
      type: Number,
      required: true
    },
    str: {
      type: String,
      // validator(value) {
      //   //规定输入的值必须是数组的内容,
      //   return ['aaa', 'bbb', 'ccc'].includes(value);
      // }
      default: 'Props规定str'
    },
    obj: {
      type: Object,
      default() {
        return {
          name: 'Jack',
          age: 18
        };
      }
    }
  }
};
</script>

<style scoped lang="scss"></style>
